package plantsversuszombies;

import phonegame.GameItem;
import java.lang.*;
import phonegame.IAlarmListener;

public class Plant extends GameItem implements IAlarmListener{
	
	private PlantsVersusZombies game;
	private int damage;
	private Bullet bullet = new Bullet(5,5,5);
	
	public Plant(PlantsVersusZombies game, int x, int y) {
		this.damage = damage;
		this.game = game;
		super.setImage("/images/gunflower.png");
		super.setPosition(x, y);
		
		this.shoot();
	}
	
	public void shoot(){
		game.addGameItem(new Bullet(super.getX(), super.getY(), 10));
		game.setTimer(30, 0, this);
	}
	
	public void alarm(int id) {
		if(id == 0) {
			this.shoot();
		}
	}
}
